<%--
  @author Kusal Samarakoon
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<script src="${pageContext.request.contextPath}/js/validateLand.js" type="text/javascript"></script>
<script type="text/javascript">


    $(function() {

        //alert(document.getElementById('organizationId').value);

        //var pls_enter_refNo = $("#pls_enter_task").val();
        var pls_enter_refNo = "Please Enter Ref No.";
        var pls_enter_valid_date = "Please Enter Valid Date";
        $("#letter-registration").validate({
            rules:{
                letterRefNo:{
                    required:true
                },
                endingDate:{
                    required: true,
                    isFeatureDate:true
                }
            },
            messages:{
                letterRefNo: {
                    required: "<br/>" + pls_enter_refNo
                },
                endingDate:{
                    required: "<br/>" + pls_enter_valid_date
                }
            }
        });


    });


</script>

<div id="letter-registration-module-home-title" class="module-home-title">
    <s:a href="home.do">
        <span><img src="${pageContext.request.contextPath}/images/data-entry.png" alt="Letter Registration">
            <span><s:label
                    value="%{getText('reg_letter_detail.label')}"/></span>
    </s:a>

</div>
<div id="letter-reg-list">
    <div class="page-title">
        <h2> <span><s:label
                value="%{getText('reg_letter_detail.label')}"/></span></h2>
    </div>
    <s:if test="hasActionErrors() || hasActionMessages()">
        <div id="message-box" class="message-box">
            <div class="action-msg"><s:actionmessage/></div>
            <div class="action-err"><s:actionerror/></div>
        </div>
    </s:if>
    <s:form id="letter-registration" name="letter-registration"
            method="POST"  onsubmit="javascript:return validateFormForInputDataSyntaxErrors('letter-registration')">


        <fieldset id="letter-registration-form" style="border:none;">
            <table class="width-100">
                <tr>
                    <td><s:label value="%{getText('reg_date.label')}" cssClass="mandatory-field"/>
                        <s:label
                                value="%{getText('date_format.label')}" cssClass="date-format"/></td>
                    <td colspan="3"><s:textfield id="endingDate" name="registeredPost.registeredDate"
                                                 onKeyPress="return dateNumbersOnly(event,true)"/></td>
                </tr>
                <tr>
                    <td><s:label value="%{getText('reg_ref_no.label')}" cssClass="mandatory-field"/></td>
                    <td colspan="3"><s:textfield id="letterRefNo" name="registeredPost.registeredPostRefNumber"/></td>
                </tr>
            </table>
            <hr/>
            <div class="form-button-div right-align">
                <s:submit action="addRegLetterDetail" value="%{getText('save.label')}"/>
                <s:submit cssClass="cancel" action="home" value="%{getText('back.label')}"/>
            </div>
        </fieldset>
        <s:hidden name="moduleId"/>
    </s:form>
</div>


